<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<%@ include file="/page/resform.jsp" %>
<script type="text/javascript">
	$(function() {
		$("#pushForm").validate();
	});
	function submitWithCheck(){
		if($("#pushtype").val()==''){
			$("#ts").remove();
			$("#pushtype").after('<span id="ts" class="pn-frequired">该项为必填项</span>');
			return;
		}else{
			$("#ts").remove();
			$("#pushForm").submit();
			return;
		}
	}
</script>
</head>
<body>
	<div class="body-box">
		<div class="rhead">
			<div class="rpos">当前位置:消息推送- ${id eq null?'新增':'修改' }</div>
			<div class="clear"></div>
		</div>
		<form method="post"  id="pushForm" action="${ctx }/push/save">
			<table width="100%" class="pn-ftable" cellpadding="2" cellspacing="1" border="0">
				<tr>
					<td width="12%" class="pn-flabel"><span class="pn-frequired">*</span>推送平台</td>
					<td colspan="1" width="38%" class="pn-fcontent">
					<select name="pushtype" id='pushtype'>
	  					<option value="">请选择</option>
						   	<c:forEach items="${itemList }" var="item">
			  					<option value="${item.code }">${item.name }</option>
			    			</c:forEach>
					  </select>				
					</td>
				</tr>
				<tr>
					<td width="12%" class="pn-flabel"><span class="pn-frequired">*</span>推送内容</td>
					<td colspan="3" width="88%" class="pn-fcontent">
						<textarea name="pushinfo" validate="{required:true,maxlength:50}"></textarea>							
					</td>
				</tr>
				<tr>
					<td colspan="4" class="pn-fbutton">
						<input id="dictsub" type="button" onclick="submitWithCheck()" value="提交" class="ps-btn"/> &nbsp; 
						<input type="reset" value="重置" class="ps-btn" />&nbsp; 
						<input type="button" value="返回" class="ps-btn" onclick="history.back();" />
					</td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>